import axios from 'axios';

let base = '';

export const requestLogin = params => { return axios.post(`${base}/login`, params).then(res => res.data); };

export const getUserList = params => { return axios.get(`${base}/user/list`, { params: params }); };

export const getUserListPage = params => { return axios.post(`${base}/user/listpage`, { params: params }); };

export const removeUser = params => { return axios.post(`${base}/user/del?id=`+params); };

export const batchRemoveUser = params => { return axios.post(`${base}/user/batchdel?ids=`+params); };

export const editUser = params => { return axios.post(`${base}/user/modify`, params); };

export const getClassListPage = params => { return axios.post(`${base}/class/listpage`, JSON.stringify(params)); };

export const removeClass = params => { return axios.post(`${base}/class/del?id=`+params); };

export const batchRemoveClass = params => { return axios.post(`${base}/class/batchdel?ids=`+params); };

export const editClass = params => { return axios.post(`${base}/class/modify`, params); };

export const removeStu = params => { return axios.post(`${base}/stu/del?id=`+params); };

export const batchRemoveStu = params => { return axios.post(`${base}/stu/batchdel?ids=`+params); };

export const editStu = params => { return axios.post(`${base}/stu/modify`, params); };

export const removeTeacher = params => { return axios.post(`${base}/teacher/del?id=`+params); };

export const batchRemoveTeacher = params => { return axios.post(`${base}/teacher/batchdel?ids=`+params); };

export const editTeacher = params => { return axios.post(`${base}/teacher/modify`, params); };
